TIMS-0102 DLL Programming Notes

This zip file contains three Jova Solutions documents you will need.

You will be using the FTDI provided FTD2XX.DLL for all communications. I have also included the FTD2XX programmers guide for reference. You may want to check their website for the latest version.

Start with the TIMS Data Link Communications Protocols.pdf. This document describes the byte packet that you will need to compose to send to our TIMS-0201 device over USB. The byte packet consists of a from and to address as well as a function code, data and LRC byte.

The other two documents describe the function codes that are available for the TIMS-0102 device. Ignore the packet definition in the TIMS-0102 Function Reference document as the TIMS Data Link Communications.pdf has the latest packet definition.

The following suggested FTD2XX.DLL function calls are based loosely on the Jova Solutions TIMS LabVIEW Device Driver architecture.

Starting Up

Call the *FT_Open* FTD2XX.DLL function, which takes a device index and returns a reference or handle to the specified device. This reference or handle is used as an input to all subsequent calls to the specified device.

DataLink I/O (Packet I/O)

Once the device is open Packets of data can be sent to the processor in the TIMS device to execute various functions. The Packet Protocol is detailed in the TIMS Data Link Communications Protocol.pdf document. This packet is a byte array that is composed of device processor address, control code, data, and an LRC byte.

The Jova Solutions TIMS LabVIEW drivers follow this procedure:

1. Flush the Rx buffer
A. Call *FT_GetStatus* to get the Rx bytes available.
B. Call *FT_Read*, passing the Rx byte count from step A.
2. Send the command - compose a communications Packet byte array
and call *FT_Write* to send the data to the device. A maximum of
256 bytes can be sent in a single *FT_Write* command so any data
packets greater than 256 bytes must be broken up into consecutive
calls of less than 256 bytes.
3. Read the device response
A. Call *FT_GetStatus* to check the number of response bytes
returned from the device.
B. Call FT_Read, passing the Rx byte count from step A.

Shutting Down

Call the *FT_Close* FTD2XX.DLL function at the end of the session to close the device and release the device reference or handle.

